package com.lonty.intelligence.mapper;

import com.lonty.intelligence.model.LeavingMessage;
import com.lonty.intelligence.request.LeavingMessageAndUser;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

/**
 * @Author 陈璇
 * @Date 2020/6/11 13:12
 * @Version 1.0
 */
@Mapper
public interface LeavingMessageMapper {

    /**
     * 保存留言
     * @param leavingMessage
     * @return
     */
    int saveLeavingMessage(LeavingMessage leavingMessage);

    /**
     * 根据ID获取留言
     * @param id
     * @return
     */
    LeavingMessageAndUser getById(String id);

    /**
     * 根据用户ID获取留言
     * @param userInfoId
     * @return
     */
    List<LeavingMessage> getByUserId(String userInfoId);

    /**
     * 获取社区所有留言
     * @return
     */
    List<LeavingMessageAndUser> getLeavingMessageAndUser(String communityId);

}
